package com.plian.system.dao.fr.indicatorsvalue;

import com.plian.Tools.pagedata.PageData;
import com.plian.system.dao.DaoSupport;
import com.plian.system.entity.fr.indicators.IndicatorsValue;
import com.plian.system.model.page.Page;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
* 说明：指标实际值
*/
@Component
public class  IndicatorsValueDao {
@Resource(name = "daoSupport")
private DaoSupport dao;

	/**
	* 新增
	* @param list
	* @throws Exception
	*/
	public void saveAll(List<PageData> list) throws Exception {
		dao.batchSave("IndicatorsValueMapper.saveAll",list);
	}

	/**
	* 修改
	* @param pd
	* @throws Exception
	*/
	public void edit(PageData pd) throws Exception {
		dao.update("IndicatorsValueMapper.edit",pd);
	}

	/**
	* * 根据Id获取一条数据
	* @param id
	* @return
	* @throws Exception
	*/
	public PageData findbyid(String id) throws Exception {
		return (PageData) dao.findForObject("IndicatorsValueMapper.findbyid",id);
	}

	/**
	 * * 根据orgId、年月和指标code获取一条数据
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	public PageData findMonthValue(PageData pd) throws Exception {
		return (PageData) dao.findForObject("IndicatorsValueMapper.findMonthValue",pd);
	}
	/**
	* 列表
	* @return
	* @throws Exception
	*/
	public List<PageData> listPage(Page page) throws Exception {
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.listPage",page);
	}
	/**
	* 批量删除
	* @return
	* @throws Exception
	*/
	public void del_ids(List<String> ids) throws Exception {
		dao.delete("IndicatorsValueMapper.del_ids",ids);
	}

	/**
	 * 根据年度删除数据
	 * @param year
	 * @throws Exception
	 */
	public void del_year(String year) throws Exception {
		dao.delete("IndicatorsValueMapper.del_year",year);
	}

	/**
	 * 根据指标code(集合)、年度、单位id(集合)查询
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	public List<PageData> findCode(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.findCode",pd);
	}
	public List<PageData> findCode1(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.findCode1",pd);
	}
	public List<PageData> findCode2(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.findCode2",pd);
	}
	/**
	 * 根据指标code(集合)、年度、单位id(集合)查询
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	public List<PageData> findListByCode(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.findListByCode",pd);
	}
	public List<PageData> graphicDetailed(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.graphicDetailed",pd);
	}

	/**
	 * 多家单位合并
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	public List<PageData> graphicDetaileds(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.graphicDetaileds",pd);
	}

	public List<PageData> getExpressTrend(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.getExpressTrend",pd);
	}
	public List<PageData> comprehensiveReport(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.comprehensiveReport",pd);
	}

	public List<PageData> comprehensiveAllReport(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.comprehensiveAllReport",pd);
	}

	public List<PageData> businessSectorReport(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.businessSectorReport",pd);
	}
	public List<PageData> plateReport(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.plateReport",pd);
	}
	public List<PageData> getBulletinIndicators(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.getBulletinIndicators",pd);
	}
    public List<PageData> getBudgetComplete(PageData pd)throws Exception{
        return (List<PageData>) dao.findForList("IndicatorsValueMapper.getBudgetComplete",pd);
    }
	public List<PageData> getBudgetWarning(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.getBudgetWarning",pd);
	}
    public List<PageData> bulletinIndustryBenchmark(PageData pd)throws Exception{
        return (List<PageData>) dao.findForList("IndicatorsValueMapper.bulletinIndustryBenchmark",pd);
    }
	public List<PageData> getIndustryDebt(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.getIndustryDebt",pd);
	}
	public List<PageData> getBudgetAndJZComplete(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.getBudgetAndJZComplete",pd);
	}
	/**
	 * 根据指标code(集合)、年度、单位id(集合)查询
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	public List<PageData> listDebtRiskWarning(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.listDebtRiskWarning",pd);
	}

	//1-x月风险预警
	public List<PageData> getBudgetWarningMonth(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.getBudgetWarningMonth",pd);
	}
	//1-12月利润、现金流量负数
	public List<PageData> getDeficitWarning(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.getDeficitWarning",pd);
	}
	//第二排仪表盘
	public List<PageData> getManagePanel(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.getManagePanel",pd);
	}
	//本年预算快报累计数柱状图
	public List<PageData> getBudgetBarchart(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.getBudgetBarchart",pd);
	}
	//预算快报水桶图
	public List<PageData> getBudgetBucket(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.getBudgetBucket",pd);
	}
	//本年预算快报每月数折线图
	public List<PageData> getBudgetLinechart(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.getBudgetLinechart",pd);
	}
	//本年与上年同期预算快报累计数柱状图
	public List<PageData> getBudgetBarchartWithLastyear(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.getBudgetBarchartWithLastyear",pd);
	}
	//本年、上年、前年预算数与完成数柱状图和折线图
	public List<PageData> getBudgetChartWithThreeYear(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.getBudgetChartWithThreeYear",pd);
	}
	//本年、上年、前年预算数与完成数柱状图（有上年同期）
	public List<PageData> getBudgetBarchartWithThreeYear(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.getBudgetBarchartWithThreeYear",pd);
	}
	//领导界面负债率排行
	public List<PageData> balanceRateRank(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.balanceRateRank",pd);
	}
	//获取集团该月的资产总额、负债总额、所有者权益、营业收入和利润总额
	public List<IndicatorsValue> getMainIndicators(PageData pd) throws Exception {
		return (List<IndicatorsValue>) dao.findForList("IndicatorsValueMapper.getMainIndicators",pd);
	}
	//获取集团该月的资产总额、负债总额、所有者权益、营业收入和利润总额
	public PageData getGroupCodesVal(PageData pd) throws Exception {
		return (PageData) dao.findForObject("IndicatorsValueMapper.getGroupCodesVal",pd);
	}
	//获取需要减去的 该月的资产总额、负债总额、所有者权益、营业收入和利润总额
	public PageData getSubtractGroupCodesVal(PageData pd) throws Exception {
		return (PageData) dao.findForObject("IndicatorsValueMapper.getSubtractGroupCodesVal",pd);
	}
	//获取需要增加的 该月的资产总额、负债总额、所有者权益、营业收入和利润总额
	public PageData getAddGroupCodesVal(PageData pd) throws Exception {
		return (PageData) dao.findForObject("IndicatorsValueMapper.getAddGroupCodesVal",pd);
	}
	//获取集团该月的资产总额、负债总额、所有者权益、营业收入和利润总额
	public List<PageData> getUnitCodesVals(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("IndicatorsValueMapper.getUnitCodesVals",pd);
	}

	public PageData getOrgCodesVal(PageData pd) throws Exception {
		return (PageData) dao.findForObject("IndicatorsValueMapper.getOrgCodesVal",pd);
	}
}
